package com.maziro.spring.service.cycle;

import com.maziro.spring.app.AppConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class ContextError {
	public static void main(String[] args) {

		// Spring上下文环境
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
//		context.register(AppConfig.class, AService.class, BService.class);
		context.register(AppConfig.class);
		context.refresh();

		AService orderService = context.getBean(AService.class);
		String order = orderService.getUser(123L);
		System.out.println(order);
	}

}
